function get(url,params,type,callback,header={}){
    
    const xhr =new XMLHttpRequest();
    let arr=[];
    for (key in params){
        arr.push(`${key}=${params[key]}`)
    }
    console.log(arr);
    xhr.open("get",`${url}?${arr.join("&")}`);
    console.log(arr.join("&"));
    xhr.onreadystatechange=()=>{
        if(xhr.readyState===4){
            
            if(xhr.status===200){
                let res=xhr.responseText;
                if(type="JSON"){
                    res= JSON.parse(xhr.responseText);
                    callback(res);

                }               
               
            }else{
                console.log(xhr.status);
            }

        }
    }
    for(key in header){
         xhr.setRequestHeader(key,header[key]);
    }
    xhr.send();
}